<!--!
This file is a part of MediaDrop (https://www.mediadrop.video),
Copyright 2009-2018 MediaDrop contributors
For the exact contribution history, see the git revision log.
The source code contained in this file is licensed under the GPLv3 or
(at your option) any later version.
See LICENSE.txt in the main project directory, for more information.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      py:with="paginator=c.paginators.users">
<xi:include href="../master.html" />
<head>
	<title>Users</title>
	<script src="${h.url_for('/scripts/third-party/squeezebox-1.1-rc4-yui-compressed.js')}" type="text/javascript"></script>
	<link href="${h.url_for('/admin/styles/squeezebox.css')}" media="screen" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="${h.url_for('/admin/scripts/confirm.js')}"></script>
	<script type="text/javascript" src="${h.url_for('/admin/scripts/users.js')}"></script>
	<script type="text/javascript">
		window.addEvent('domready', function(){
			var um = new UserMgr({
				deleteConfirmMgr: {
					header: '${_('Confirm Delete').replace("'", "\\'")}',
					confirmButtonText: '${_('Delete').replace("'", "\\'")}',
					cancelButtonText: '${_('Cancel').replace("'", "\\'")}',
					msg: '${_('Are you sure you want to delete this user?').replace("'", "\\'")}'
				}
			});
		});
	</script>
</head>
<body class="menu-users-on">
	<div class="box">
		<div class="box-head">
			<h1>Users</h1>
			<a id="add-btn" href="${h.url_for(action='edit', id='new')}" class="btn inline btn-add-user"><span>Add User</span></a>
			<!--!<span class="box-head-sec">${h.doc_link('admin/settings', 'users')}</span>-->
		</div>
		<table cellpadding="0" cellspacing="0" id="user-table">
			<thead>
				<tr>
					<th id="h-display_name" style="width:205px">Display Name</th>
					<th id="h-email" style="width:auto">Email</th>
					<th id="h-group" style="width:105px">Group</th>
					<th id="h-btns" style="width:63px">&nbsp;</th>
				</tr>
			</thead>
			<tbody>
				<tr py:if="len(users) == 0">
					<td>None Found</td>
				</tr>
				<tr py:for="user in users">
					<td headers="h-display_name"><a href="${h.url_for(action='edit', id=user.id)}" py:content="user.display_name">Display Name</a></td>
					<td headers="h-email"><a href="mailto:${user.email_address}" py:content="user.email_address">email address</a></td>
					<td headers="h-group" py:content="user.groups and user.groups[0].display_name or None">group</td>
					<td headers="h-btns">
						<form action="${h.url_for(action='delete', id=user.id)}" method="post" class="delete-user-form right">
							<a href="${h.url_for(action='edit', id=user.id)}" class="btn table-row middle btn-inline-edit"><span>Edit</span></a><button class="btn table-row delete btn-inline-delete" type="submit" name="delete"><span>Delete</span></button>
						</form>
					</td>
				</tr>
			</tbody>
			${paginated_tfoot(c.paginators.users, '4')}
		</table>
	</div>
</body>
</html>
